<?php
require_once(dirname(__FILE__)."/../common/constants.php");
require_once(MOBILE_DIR_PATH."/http_common.php");
require_once(MOBILE_DIR_PATH."/auth_handler.php");

$auth_handler = new HttpAuthHandler(HTTP::POST);
$dispatcher = new HttpDispatcher(HTTP::POST);

if ($_POST['t'] == HttpAction::POST_CALENDAR)
	$listener = new HttpPostCalendarListener();
else if ($_POST['t'] == HttpAction::GET_CALENDAR)
	$listener = new HttpGetCalendarListener();
	
$dispatcher->addListener($listener);
$auth_handler->setHttpHandler($dispatcher);
$auth_handler->auth();
?>